<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<div class="table-responsive">
<table class="cntable table table-bordered dataTable table-customerDemo ">
	<thead>
		<tr>
		    <th style="width: 50px">序号</th>
		    <th style="width: 50px">用户编号</th>
			<th style="width: 100px">用户名</th>
			<th style="width: 50px">推荐人编号</th>
			<th style="width: 100px">用户级别</th>
			<th style="width: 100px">注册时间</th>
			<th style="width: 100px">操作</th>
		</tr>
	</thead>
	 <tbody>
		<c:forEach var="customerDemo" items="${customerDemos}" varStatus="status">
		<tr data-id="${customerDemo.id}">
		   <td>${status.index+1}</td> 
		   <td>${customerDemo.userIdentity}</td>
		   <td>${customerDemo.username}</td>
		   <td>${customerDemo.refereeIdentity}</td>						
           <td>
              <t:provider packageName="acc" enumClassName="CustomerDemoLevel" value="${customerDemo.level}"/> 
           </td>
           <td>
           	  <fmt:formatDate value="${customerDemo.registDate}" type="date" dateStyle="default" pattern="yyyy-MM-dd HH:mm:ss"/>
           </td>
           <td class="text-center ">
			  <input type="hidden" value="${customerDemo.id}" class="customerDemoId" />
			  <input type="hidden" value="${customerDemo.userIdentity}" class="cusUserIdentity" />
			  <a href="#" class="text-slate-700 find"><i class="icon-magazine"></i>发展团队</a>  
			  <a href="#" class="text-slate-700 test"><i class="icon-calculator"></i>消费测试</a>          
		   </td>
		</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<th class="pager-th absolute-pos"><%@ include
					file="/WEB-INF/views/shared/master/pager.jsp"%>
			</th>
		</tr>
	</tfoot>
</table>
</div>
<script type="text/javascript">
$(".find").click(function(){
	    var referee=$(this).parent().find(".customerDemoId").val();
	    var cusUserIdentity=$(this).parent().find(".cusUserIdentity").val();
	    top.openModal("/admin/acc/customerDemo/customerDemoDetailed?referee="+referee+"&cusUserIdentity=" + cusUserIdentity,"customerDemo_form","测试用户详情-添加",400,240);
}) 

$(".test").click(function(){
	    var id=$(this).parent().find(".customerDemoId").val();
	    var url=$.getVirtualPath()+"/admin/acc/customerDemo/toTest";
        $.post(url,{key:id},function(res){
        	$("#result").html(res);
        })
}) 
</script>